;;;
;;;
;;;	Author:	Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;		http://paracadd.com
;;;		All rights reserved.
;;;
;;;		COPYRIGHT: 7/1/2011
;;;		   EDITED: 7/1/2011
;;;
(defun c:striplayersuffix ( / layer-suffix strip-ss1 count pre-ss1)
  (if ustr nil (load "ustr" "\nFile USTR.LSP not loaded! "))
  (if c:tolayer nil (load "tolayer" "\nFile TOLAYER.LSP not loaded! "))
  (setq layer-suffix (ustr 1 "Layer suffix to strip from existing entity layers" layer-suffix T))
  (setq strip-ss1 (ssget (list (cons 8 (strcat "*?" layer-suffix)))))
  (setq count 0)
  (while (< count (sslength strip-ss1))
    (setq pre-ss1 (ssadd))
    (ssadd (ssname strip-ss1 count) pre-ss1)
    (c:tolayer)
    (PRINC "\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010")
    (PRINC count)
    (PRINC)
    (setq count (1+ count))
  )
  (SETQ layer-suffix NIL strip-ss1 NIL count NIL pre-ss1 NIL)
  (PRINC)
)